<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* await
        1.相当于执行了promise的then函数
        2.await后面不一定更promise
        3.await阻塞了代码执行流程，会优先执行后面的同步代码再执行
        */
       async function show(){
           console.log("start");
           await mid();
        //    var res =await mid();
        //    console.log(res);
           console.log("end");
       }
       async function mid(){
           console.log("mid");
           return 1;
       }
       show();
       console.log("a1");
    </script>
</body>
</html>